import request from "@/utils/request";

// 查询租赁合同主列表
export function listRentContractM(query) {
  return request({
    url: "/rent/rentContractM/list",
    method: "get",
    params: query,
  });
}

// 查询租赁合同主详细
export function getRentContractM(id) {
  return request({
    url: "/rent/rentContractM/" + id,
    method: "get",
  });
}

// 新增租赁合同主
export function addRentContractM(data) {
  return request({
    url: "/rent/rentContractM",
    method: "post",
    data: data,
  });
}

// 修改租赁合同主，会删除子表
export function updateRentContractM(data) {
  return request({
    url: "/rent/rentContractM",
    method: "put",
    data: data,
  });
}

// 修改租赁合同主，不影响子表
export function editRentContractM(data) {
  return request({
    url: "/rent/rentContractM/editRentContractM",
    method: "put",
    data: data,
  });
}

// 删除租赁合同主
export function delRentContractM(id) {
  return request({
    url: "/rent/rentContractM/" + id,
    method: "delete",
  });
}

// 查询单号
export function getContractDocumentNo() {
  return request({
    url: "/rent/rentContractM/getContractDocumentNo",
    method: "get",
  });
}

// 查询租赁合同主列表(包含上期租金结算日期，上期印量结算日期)
export function selectContractMDetail(query) {
  return request({
    url: "/rent/rentContractM/selectContractMDetail",
    method: "get",
    params: query,
  });
}

// 审核合同
export function auditRentContractM(data) {
  return request({
    url: "/rent/rentContractM/audit",
    method: "put",
    data: data,
  });
}
